<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Struct template pointer_traits&lt;T *&gt;</title>
<link rel="stylesheet" href="../../../doc/src/boostbook.css" type="text/css">
<meta name="generator" content="DocBook XSL Stylesheets V1.79.1">
<link rel="home" href="../index.html" title="The Boost C++ Libraries BoostBook Documentation Subset">
<link rel="up" href="../intrusive/reference.html#doxygen.pointer__traits_8hpp" title="Header &lt;boost/intrusive/pointer_traits.hpp&gt;">
<link rel="prev" href="structboost_1_1intrusive_1_1pointer__traits.html" title="Struct template pointer_traits">
<link rel="next" href="structboost_1_1intrusive_1_1pointer__traits_3_01T_01_5_01_4_1_1rebind__pointer.html" title="Struct template rebind_pointer">
<meta name="viewport" content="width=device-width, initial-scale=1">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<table cellpadding="2" width="100%"><tr>
<td valign="top"><img alt="Boost C++ Libraries" width="277" height="86" src="../../../boost.png"></td>
<td align="center"><a href="../../../index.html">Home</a></td>
<td align="center"><a href="../../../libs/libraries.htm">Libraries</a></td>
<td align="center"><a href="http://www.boost.org/users/people.html">People</a></td>
<td align="center"><a href="http://www.boost.org/users/faq.html">FAQ</a></td>
<td align="center"><a href="../../../more/index.htm">More</a></td>
</tr></table>
<hr>
<div class="spirit-nav">
<a accesskey="p" href="structboost_1_1intrusive_1_1pointer__traits.html"><img src="../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../intrusive/reference.html#doxygen.pointer__traits_8hpp"><img src="../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../index.html"><img src="../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="structboost_1_1intrusive_1_1pointer__traits_3_01T_01_5_01_4_1_1rebind__pointer.html"><img src="../../../doc/src/images/next.png" alt="Next"></a>
</div>
<div class="refentry">
<a name="doxygen.structboost_1_1intrusive_1_1pointer__traits_3_01T_01_5_01_4"></a><div class="titlepage"></div>
<div class="refnamediv">
<h2><span class="refentrytitle">Struct template pointer_traits&lt;T *&gt;</span></h2>
<p>boost::intrusive::pointer_traits&lt;T *&gt;</p>
</div>
<h2 class="refsynopsisdiv-title">Synopsis</h2>
<div class="refsynopsisdiv"><pre class="synopsis"><span class="comment">// In header: &lt;<a class="link" href="../intrusive/reference.html#doxygen.pointer__traits_8hpp" title="Header &lt;boost/intrusive/pointer_traits.hpp&gt;">boost/intrusive/pointer_traits.hpp</a>&gt;

</span><span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> T<span class="special">&gt;</span> 
<span class="keyword">struct</span> <a class="link" href="structboost_1_1intrusive_1_1pointer__traits_3_01T_01_5_01_4.html" title="Struct template pointer_traits&lt;T *&gt;">pointer_traits</a><span class="special">&lt;</span><span class="identifier">T</span> <span class="special">*</span><span class="special">&gt;</span> <span class="special">{</span>
  <span class="comment">// <a class="link" href="structboost_1_1intrusive_1_1pointer__traits_3_01T_01_5_01_4.html#doxygen.structboost_1_1intrusive_1_1pointer__traits_3_01T_01_5_01_4types">types</a></span>
  <span class="keyword">typedef</span> <span class="identifier">T</span>              <a name="doxygen.structboost_1_1intrusive_1_1pointer__traits_3_01T_01_5_01_4_1a1c6998e5782117b08fac8291bfdc7f97"></a><span class="identifier">element_type</span><span class="special">;</span>   
  <span class="keyword">typedef</span> <span class="identifier">T</span> <span class="special">*</span>            <a name="doxygen.structboost_1_1intrusive_1_1pointer__traits_3_01T_01_5_01_4_1a74fef2e23cda36e0dcbc4843cb3e7cf8"></a><span class="identifier">pointer</span><span class="special">;</span>        
  <span class="keyword">typedef</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">ptrdiff_t</span> <a name="doxygen.structboost_1_1intrusive_1_1pointer__traits_3_01T_01_5_01_4_1af3cac6c6184e99381732f66331237a18"></a><span class="identifier">difference_type</span><span class="special">;</span>
  <span class="keyword">typedef</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">size_t</span>    <a name="doxygen.structboost_1_1intrusive_1_1pointer__traits_3_01T_01_5_01_4_1a9b6fe93be9eae46567674218dd2cea04"></a><span class="identifier">size_type</span><span class="special">;</span>      
  <span class="keyword">typedef</span> <span class="identifier">T</span> <span class="special">&amp;</span>            <a name="doxygen.structboost_1_1intrusive_1_1pointer__traits_3_01T_01_5_01_4_1a6ee2e970ebd868d8f4319520b4587568"></a><span class="identifier">reference</span><span class="special">;</span>      
  <span class="keyword">typedef</span> <span class="identifier">U</span> <span class="special">*</span>            <a class="link" href="structboost_1_1intrusive_1_1pointer__traits_3_01T_01_5_01_4.html#doxygen.structboost_1_1intrusive_1_1pointer__traits_3_01T_01_5_01_4_1a2516e6ca25745cdd5f1621ad6fa9d791"><span class="identifier">rebind</span></a><span class="special">;</span>         

  <span class="comment">// member classes/structs/unions</span>
  <span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> U<span class="special">&gt;</span> 
  <span class="keyword">struct</span> <a class="link" href="structboost_1_1intrusive_1_1pointer__traits_3_01T_01_5_01_4_1_1rebind__pointer.html" title="Struct template rebind_pointer">rebind_pointer</a> <span class="special">{</span>
    <span class="comment">// types</span>
    <span class="keyword">typedef</span> <span class="identifier">U</span> <span class="special">*</span> <a class="link" href="structboost_1_1intrusive_1_1pointer__traits_3_01T_01_5_01_4_1_1rebind__pointer.html#doxygen.structboost_1_1intrusive_1_1pointer__traits_3_01T_01_5_01_4_1_1rebind__pointer_1a950ee90c98e32aed542ff75e1c053fd0"><span class="identifier">type</span></a><span class="special">;</span>
  <span class="special">}</span><span class="special">;</span>

  <span class="comment">// <a class="link" href="boost_container_header_reference/classboost_1_1container_1_1new__allocator.html#id64-bb">public static functions</a></span>
  <span class="keyword">static</span> <span class="identifier">pointer</span> <a class="link" href="structboost_1_1intrusive_1_1pointer__traits_3_01T_01_5_01_4.html#doxygen.structboost_1_1intrusive_1_1pointer__traits_3_01T_01_5_01_4_1aa4c1bf4b1fa25cdbaa08a4ebfba9cbc8"><span class="identifier">pointer_to</span></a><span class="special">(</span><span class="identifier">reference</span><span class="special">)</span> <span class="keyword">noexcept</span><span class="special">;</span>
  <span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> U<span class="special">&gt;</span> <span class="keyword">static</span> <span class="identifier">pointer</span> <a class="link" href="structboost_1_1intrusive_1_1pointer__traits_3_01T_01_5_01_4.html#doxygen.structboost_1_1intrusive_1_1pointer__traits_3_01T_01_5_01_4_1a0609024f965e1436b4e74bc5bf8061d0"><span class="identifier">static_cast_from</span></a><span class="special">(</span><span class="identifier">U</span> <span class="special">*</span><span class="special">)</span> <span class="keyword">noexcept</span><span class="special">;</span>
  <span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> U<span class="special">&gt;</span> <span class="keyword">static</span> <span class="identifier">pointer</span> <a class="link" href="structboost_1_1intrusive_1_1pointer__traits_3_01T_01_5_01_4.html#doxygen.structboost_1_1intrusive_1_1pointer__traits_3_01T_01_5_01_4_1a245f2a5f0cc97258d57d6ff944c18742"><span class="identifier">const_cast_from</span></a><span class="special">(</span><span class="identifier">U</span> <span class="special">*</span><span class="special">)</span> <span class="keyword">noexcept</span><span class="special">;</span>
  <span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> U<span class="special">&gt;</span> <span class="keyword">static</span> <span class="identifier">pointer</span> <a class="link" href="structboost_1_1intrusive_1_1pointer__traits_3_01T_01_5_01_4.html#doxygen.structboost_1_1intrusive_1_1pointer__traits_3_01T_01_5_01_4_1a5f676605a5915648dfb08bed1e18a78f"><span class="identifier">dynamic_cast_from</span></a><span class="special">(</span><span class="identifier">U</span> <span class="special">*</span><span class="special">)</span> <span class="keyword">noexcept</span><span class="special">;</span>
<span class="special">}</span><span class="special">;</span></pre></div>
<div class="refsect1">
<a name="id-1.3.17.42.26.4.4"></a><h2>Description</h2>
<p>Specialization of <a class="link" href="structboost_1_1intrusive_1_1pointer__traits.html" title="Struct template pointer_traits">pointer_traits</a> for raw pointers </p>
<div class="refsect2">
<a name="id-1.3.17.42.26.4.4.3"></a><h3>
<a name="doxygen.structboost_1_1intrusive_1_1pointer__traits_3_01T_01_5_01_4types"></a><code class="computeroutput">pointer_traits</code> 
        public
       types</h3>
<div class="orderedlist"><ol class="orderedlist" type="1"><li class="listitem">
<p>
<span class="keyword">typedef</span> <span class="identifier">U</span> <span class="special">*</span> <a name="doxygen.structboost_1_1intrusive_1_1pointer__traits_3_01T_01_5_01_4_1a2516e6ca25745cdd5f1621ad6fa9d791"></a><span class="identifier">rebind</span><span class="special">;</span></p>
<pre class="programlisting"><span class="identifier">U</span> <span class="special">*</span></pre>
<p>For portable code for C++03 and C++11, </p>
<pre class="programlisting"><span class="keyword">typename</span> <span class="identifier">rebind_pointer</span><span class="special">&lt;</span><span class="identifier">U</span><span class="special">&gt;</span><span class="special">::</span><span class="identifier">type</span></pre>
<p> shall be used instead of rebind<span style="color: red">&lt;underline&gt; to obtain a pointer to U. &lt;/underline&gt;</span></p>
</li></ol></div>
</div>
<div class="refsect2">
<a name="id-1.3.17.42.26.4.4.4"></a><h3>
<a name="id64-bb"></a><code class="computeroutput">pointer_traits</code> public static functions</h3>
<div class="orderedlist"><ol class="orderedlist" type="1">
<li class="listitem">
<pre class="literallayout"><span class="keyword">static</span> <span class="identifier">pointer</span> <a name="doxygen.structboost_1_1intrusive_1_1pointer__traits_3_01T_01_5_01_4_1aa4c1bf4b1fa25cdbaa08a4ebfba9cbc8"></a><span class="identifier">pointer_to</span><span class="special">(</span><span class="identifier">reference</span> r<span class="special">)</span> <span class="keyword">noexcept</span><span class="special">;</span></pre>
<p><span class="bold"><strong>Returns</strong></span>: addressof(r) </p>
</li>
<li class="listitem">
<pre class="literallayout"><span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> U<span class="special">&gt;</span> <span class="keyword">static</span> <span class="identifier">pointer</span> <a name="doxygen.structboost_1_1intrusive_1_1pointer__traits_3_01T_01_5_01_4_1a0609024f965e1436b4e74bc5bf8061d0"></a><span class="identifier">static_cast_from</span><span class="special">(</span><span class="identifier">U</span> <span class="special">*</span> uptr<span class="special">)</span> <span class="keyword">noexcept</span><span class="special">;</span></pre>
<p><span class="bold"><strong>Returns</strong></span>: static_cast&lt;pointer&gt;(uptr) </p>
</li>
<li class="listitem">
<pre class="literallayout"><span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> U<span class="special">&gt;</span> <span class="keyword">static</span> <span class="identifier">pointer</span> <a name="doxygen.structboost_1_1intrusive_1_1pointer__traits_3_01T_01_5_01_4_1a245f2a5f0cc97258d57d6ff944c18742"></a><span class="identifier">const_cast_from</span><span class="special">(</span><span class="identifier">U</span> <span class="special">*</span> uptr<span class="special">)</span> <span class="keyword">noexcept</span><span class="special">;</span></pre>
<p><span class="bold"><strong>Returns</strong></span>: const_cast&lt;pointer&gt;(uptr) </p>
</li>
<li class="listitem">
<pre class="literallayout"><span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> U<span class="special">&gt;</span> <span class="keyword">static</span> <span class="identifier">pointer</span> <a name="doxygen.structboost_1_1intrusive_1_1pointer__traits_3_01T_01_5_01_4_1a5f676605a5915648dfb08bed1e18a78f"></a><span class="identifier">dynamic_cast_from</span><span class="special">(</span><span class="identifier">U</span> <span class="special">*</span> uptr<span class="special">)</span> <span class="keyword">noexcept</span><span class="special">;</span></pre>
<p><span class="bold"><strong>Returns</strong></span>: dynamic_cast&lt;pointer&gt;(uptr) </p>
</li>
</ol></div>
</div>
</div>
</div>
<div class="copyright-footer">Copyright © 2005 Olaf Krzikalla<br>Copyright © 2006-2015 Ion Gaztanaga<p>
        Distributed under the Boost Software License, Version 1.0. (See accompanying
        file LICENSE_1_0.txt or copy at <a href="http://www.boost.org/LICENSE_1_0.txt" target="_top">http://www.boost.org/LICENSE_1_0.txt</a>)
      </p>
</div>
<hr>
<div class="spirit-nav">
<a accesskey="p" href="structboost_1_1intrusive_1_1pointer__traits.html"><img src="../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../intrusive/reference.html#doxygen.pointer__traits_8hpp"><img src="../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../index.html"><img src="../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="structboost_1_1intrusive_1_1pointer__traits_3_01T_01_5_01_4_1_1rebind__pointer.html"><img src="../../../doc/src/images/next.png" alt="Next"></a>
</div>
</body>
</html>
